package generateur;

import echiquier.Echiquier;
import echiquier.Echiquier.Case;
import piece.*;
import static echiquier.Echiquier.Case.*;

public class Position {

    private AbstractPiece[] pieces;

    public Position() {

        pieces = new AbstractPiece[120];
        new Piece();
        placer(Piece.Dame_Blanche, d1);
        placer(Piece.Roi_Blanc, e1);
        placer(Piece.Cavalier_Noir, b8);
        placer(Piece.Roi_Noir, e8);
    }

    public final void placer(final AbstractPiece piece, final Case _case) {
        pieces[Echiquier.valeur(_case)] = piece;
    }

    public final AbstractPiece piece(final Case _case) {
        assert _case != null & pieces != null;
        return pieces[Echiquier.valeur(_case)];
    }
    
}
